package com.luo.chengrui.module.sa.dal.mysql.role;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import com.luo.chengrui.module.sa.dal.dataobject.role.RoleFolderUserDO;
import com.luo.chengrui.module.sa.dal.dataobject.role.RoleFolderUserViewDO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Mapper;
import com.luo.chengrui.module.sa.controller.admin.role.vo.*;
import org.apache.ibatis.annotations.Param;
import org.apache.poi.ss.formula.functions.T;

/**
 * 角色分类人员配置表 Mapper
 *
 * @author 诚睿
 */
@Mapper
public interface RoleFolderUserMapper extends BaseMapperX<RoleFolderUserDO> {

    default PageResult<RoleFolderUserDO> selectPage(RoleFolderUserPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<RoleFolderUserDO>()
                .eqIfPresent(RoleFolderUserDO::getRoleFolderId, reqVO.getRoleFolderId())
                .eqIfPresent(RoleFolderUserDO::getOrgInId, reqVO.getOrgInId())
                .orderByDesc(RoleFolderUserDO::getId));
    }

    default List<RoleFolderUserDO> selectList(RoleFolderUserExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<RoleFolderUserDO>()
                .eqIfPresent(RoleFolderUserDO::getRoleFolderId, reqVO.getRoleFolderId())
                .eqIfPresent(RoleFolderUserDO::getOrgInId, reqVO.getOrgInId())
                .orderByDesc(RoleFolderUserDO::getId));
    }

    IPage<RoleFolderUserViewDO> selectPageCustomize(IPage<T> mpPage,@Param("params") RoleFolderUserPageReqVO pageVO);

    List<RoleFolderUserDO> selectListByPsmIds(@Param("psmIds") List<String> psmIds,@Param("authType") String authType);
}
